from pywinauto.application import Application

# 安装7zip
def zip7():
    app = Application().Start(cmd_line=u'"C:\\7z1900-x64.exe"')
    # print(app)
    window = app.Dialog
    window.Wait('ready')
    # 点击安装
    window.Button2.Click()
    while(True):
        if window.Button2.exists():
            print(window.Button2.exists())
            break
    
    # print(window.Button2.exists())
    # 结束安装程序
    window.CloseButton.Click()
    app.Kill_()

def main():
    zip7()
    print("1")

# if __name__=="__main__":
main()